home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
User's Choice Windows CD
/
User's Choice Windows CD (CMS Software)(1993).iso
/
windows4
/
pcproj.zip
/
PROJAPP.ACT
< prev
next >
Wrap
Text File
|
1989-12-30
|
3KB
|
94 lines
/* ProjApp.act --based on the skeleton file UserApp.act.
This file is used during the seal off process to define
methods specific to the project application.
*/
/* Define the application class */
inherit(Object, #ProjApp, #(pw), nil, nil)!!
/* Define an init method for ProjApp. This is executed when the
application starts up, and must create the windows and objects
necessary for the application.
*/!!
now(ProjApp)!!
/* Start the application and display the About box.
If a command line has been specified, then the first word is the
image file and the second is the data file. If a command line
is specified, load the data file using the appropriate extension. */
Def init(self , cmdLine | dlg, fName)
{ initSystem(self);
register(ProjWindow);
register(GanttWindow);
pw := new(ProjWindow, nil, nil, loadString(PW_APPNAME), nil);
show(pw, CmdShow);
pw.isMain := true;
if cmdLine
fName := words(cmdLine)[1];
if size(fName) > 1
fileOpen(pw, fName + "." + loadString(PW_EXTENSION));
endif;
endif;
dlg := new(Dialog);
runModal(dlg, ABOUT_BOX, pw);
/* move the cursor to the top in case there's no mouse */
setCursorPos(pw, point(pw.boxHSpace, pw.boxHeight));
}!!
/* Check if it's ok to close the window. */
Def shouldClose(self)
{
^shouldClose(pw);
}!!
/* The installation method for the application.
This removes the compiler and miscelaneous junk and then
takes a snapshot.
Note: This method must be invoked via abort(installProj));
or abort(Object.methods[#installProj]);
*/
now(Object)!!
Def installProj(self)
{ setName(VImage, "Project.ima");
removeCompiler();
removeJunk(); /* unused methods */
TheApp := new(ProjApp);
printLine("sealing off...");
cleanup();
create(VImage);
snap(VImage, 62, 25); /* Static and Dynamic memory */
/* adjust later with MemChg.EXE */
close(VImage);
exit();
}!!
/* Remove unused methods during seal off. */
Def removeJunk(self)
{
removeGlobal(#OrderedDictionary);
removeGlobal(#TextCollection);
printLine("removing...");
removeMethods(Number, #(cos sqrt tan sin exp log arcCos arcSin degToRad
radToDeg));
removeMethods(Int, #(random));
removeMethods(Rect, #(inflate offset intersect union));
removeMethods(Object, #(removeCompiler));
removeMethods(Network, #(show));
removeMethods(Node, #(show));
removeMethods(Date, #(asLongString asVeryLongString asDayString
diff inc dec next previous dayOfWeek));
removeMethods(DateClass, #(current));
/* automatically generated by space optimize utility */
removeJunk1();
removeJunk2();
removeMethods(Object, #(removeJunk1 removeJunk2));
}!!